<template>
  <div class="no-data-container" style="height: 100%;">
    <div class="no-data-box">
      <slot v-if="imgSlot" name="img" />
      <i-icon v-else type="ios-filing-outline" class="no-data-img" />
      <slot v-if="textSlot" name="text" />
      <div v-else class="no-data-text">暂无数据</div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'NoData',
  data () {
    return {
      imgSlot: null,
      textSlot: null
    }
  },
  created() {
    const { $slots: {img, text} } = this
    this.imgSlot = img
    this.textSlot = text
  }
}
</script>
